package com.ruoyi.crm.controller;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.system.api.RemoteUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestUserController
{
    @Autowired
    private RemoteUserService remoteUserService;

    /**
     * 获取当前用户信息
     */
    @GetMapping("/user/{username}")
    public Object info(@PathVariable("username") String username)
    {
        return remoteUserService.getUserInfo(username, SecurityConstants.INNER);
    }

    @GetMapping("/user/test")
    public Object test()
    {
        return "关联链接所返回的请求数据";
    }
}